<!----------------------------- body ---------------------------------------->
<div id="h_main" class="main_width">
    <!--- search --->
    <?php
        if(in_array($category_search, Configure::read('Category.service'))){
            echo $this->element('search_service');
        }
        else if(in_array($category_search, Configure::read('Category.office'))){
            echo $this->element('searchoffice');
        }elseif(in_array($category_search, Configure::read('Category.shop'))){
            echo $this->element('search_shop');
        }else echo $this->element('search');
    ?>
    <!--- end search -->
    
    <!-- breadcrumb -->
    <?php echo $this->element('breadcrumb',array('breadcrumb' => $breadcrumb)); ?>
    <!-- end breadcrumb -->
    
    <!-- description category -->
    <div class="boder_radius">
        <!--<h4><?php echo $category['category_language'][0]['name']?></h4>-->
        <?php echo $category['category_language'][0]['description']?>
    </div>
    <!-- end description category -->
    <?php echo $this->element('listProduct',array('location' => ID_LOCATION_HCM,'products' => $hcmProducts,'title_list' => 'Ho Chi Minh City')); ?>
    <?php echo $this->element('listProduct',array('location' => ID_LOCATION_HANOI,'products' => $hnProducts,'title_list' => 'Ha Noi')); ?>
    <br>
    <?php //echo $this->Paginator->pagination(array('div' => 'pagination pagination-centered')); ?>
</div>
<script>
    $(document).ready(function(){
        $('.view_more_category').click(function(){
            var parentList = $(this).parents('.h_container_list');
            var count_product = parentList.find('.h_list_product li').size();
            var location = $(this).data('location');
            $.ajax({
                url: '<?php echo $this->Html->url('/categories/ajax')?>',
                data: {'count':count_product,'location':location,'id':<?php echo $categoryID?>},
                type: 'post',
                dataType: 'html',
                success: function(data){
                    parentList.find('.last_list_product').before(data);
                }
            });
            return false;
        });
    });
</script>